﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
//using System.Web.Mvc.
using System.Web.Security;
using Leiktuther.Models;

namespace Leiktuther.Controllers
{
    public class UserController : Controller
    {
        //
        // GET: /User/
        [HttpGet]
        public ActionResult Index()
        {
            //Membership.GetUser(User.Identity.Name),
            return View();
        }

        public ActionResult Info()
        {
            return View();
        }

        [Authorize(Roles="Admin")]
        public ActionResult RemoveUser(string userinn)
        {
                var gRepo = new PlayerRepository();
                gRepo.RemovePlayerByString(userinn);
                return RedirectToAction("Index", "User");
        }
        /*
                public ActionResult AddRole(string rolid)
                {
                    Roles.CreateRole(rolid);
                    return View();
                }
                */
        public ActionResult AddAdmin(string userinn)
        {
            
            Roles.AddUserToRole(userinn, "Admin");
            return View();
        }

        public ActionResult List()
        {
            return View();
        }

        public ActionResult AdminStat()
        {
            GameRepository _gameRepo = new GameRepository();
            var model = _gameRepo.getPlayerStatistics();
            return View(model);
        }
        
        public ActionResult Edit()
        {
            return View();
        }
    }
}
